package com.juzipi.controller;

import com.juzipi.common.core.BaseController;
import com.juzipi.common.tools.Result;
import com.juzipi.service.impl.StudentService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author juzipi
 * @Date 2021/4/14 17:19
 * @Info
 */
@RestController
@RequestMapping("student")
public class StudentController extends BaseController {


    @Autowired
    private StudentService studentService;


    @PreAuthorize("hasAnyRole('user','admin','super')")
    @GetMapping("student")
    @ApiOperation("根据id获取学生")
    public Result queryStudentById(@RequestParam Long studentId){
        return JudgeResult(studentService.queryStudentById(studentId));
    }


    


}
